package com.zhangck.bos2_0.Service.system.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhangck.bos2_0.Service.system.PermissionServices;
import com.zhangck.bos2_0.dao.system.PermissionRepository;

import cn.itcast.bos.domain.system.Permission;
import cn.itcast.bos.domain.system.User;

/** 
* @author 上午茶
* @version 创建时间：2018年6月16日 下午7:10:48 
* 类说明 
*/
@Service
@Transactional
public class PermissionServicesImpl  implements PermissionServices{

	@Autowired
	private PermissionRepository permissionRepository;
	
	@Override
	public List<Permission> findByUsername(User user) {
		return permissionRepository.findByUser(user.getId());
	}

	@Override
	public List<Permission> findAll() {
		return permissionRepository.findAll();
	}

	@Override
	public void save(Permission model) {
		permissionRepository.save(model);
	}

	
	
}
